import logging
import yagmail
def log_set():
    logging.basicConfig(level=logging.INFO,filename="log.txt",format="%(message)s_%(asctime)s")
def send_mail(filename):
    mail=yagmail.SMTP(user="2071730624@qq.com",password="ulysgdzvaqjwbfcd",host="smtp.qq.com")
    mail.send(to="2071730624@qq.com",subject="测试报告",contents="内容",attachments=filename)